<?php
/**
 * 支付日志类
 *
 * @auther 大耳牛
 * 2017-2-16
 **/
namespace Xijie\Model;
use Think\Model;
class GobacklogModel extends Model{
	//定义表名称
	protected $tableName = 'goback_log';
	
	/**
	 * 获取会员列表总数
	 *
	 **/
	public function getGobacklogCount($where=array()){
		return $this->where($where)->count();
	}
	
	/**
	 * 获取会员列表
	 *
	 **/
	public function getGobacklogList($page, $where=array()){
		return $this->where($where)
				->order('id desc')
				->page($page, C('PAGE_SIZE'))
				->select();
	}
	
	/**
	 * 添加支付日志
	 **/
	public function addGobacklogInfo($data){
		$row = $this->data($data)->add();
		return $row;
	}
	
	/**
	 * 批量添加日志
	 **/
	public function addGobackAllLog($data){
		return $this->addAll($data);
	}
	
	/**
	 * 获取详情
	 **/
	public function getGobackLogInfoById($id){
		return $this->where(array('id' => $id))->find();
	}
	
	/**
	 * 编辑状态
	 **/
	public function editGobackLogStatusById($id, $data){
		$row = $this->where(array('id' => $id))->setField($data);
		//echo $this->_sql();
		return $row;
	}
	
	/**
	 * 获取单用户历史
	 **/
	public function getGobackLogListByWhere($where = array()){
		return $this->where($where)->order('id desc')->select();
	}
}
